home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / fractal / readme.amiga < prev    next >
Text File  |  1996-07-02  |  10KB  |  260 lines

  1.  
  2.  FRACTAL package
  3.  Amiga Port V1.0   (enc/dec V0.03/0.05)
  4.  
  5.  Copyright 1993,1994 Yuval Fisher. All rights reserved.
  6.  Amiga port done in 1996 by Andreas R. Kleinert
  7.  
  8.  (For the complete sources by Y. Fisher please refer to
  9.   http://inls.ucsd.edu/y/home.html where you may branch to
  10.   http://inls.ucsd.edu/y/fractals/ and obtain the possible rest from)
  11.  
  12.  Sources changed for and compiled with SAS/C V6.56 with
  13.  settings for 68030/68881.
  14.   
  15.  Port release date: 02. July 1996
  16.  
  17.  
  18.  COPYRIGHT AND AUTHOR
  19.  --------------------
  20.  The basic routines for encoding a byte image using a fractal scheme
  21.  with a quadtree partition and decoding an image encoded with a quadtree
  22.  partition based fractal scheme have been developed by
  23.  Yuval Fisher (yfisher@ucsd.edu), who also wrote two small programs
  24.  for handling that.
  25.  
  26.  The work as described in the following is based on the files
  27.  enc.c (Version 0.03 3/14/94) and dec.c (Version 0.05 10/10/94),
  28.  which are both Copyright 1993,1994 Yuval Fisher. All rights reserved.
  29.  
  30.  The original copyright notice can be found in the file COPYING
  31.  - this file you are reading right NOW only contains additional
  32.  information, refering to the Amiga port.
  33.  
  34.  
  35.  DISCLAIMER
  36.  ----------
  37.  Before you do anything else, read the DISCLAIMER for the work
  38.  and changes I did on the Amiga port of this tool:
  39.  
  40.  THERE IS NO WARRANTY FOR THE PROGRAMS.
  41.  THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAMS
  42.  "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  43.  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  44.  AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
  45.  AND PERFORMANCE OF THE PROGRAMS IS WITH YOU.
  46.  SHOULD THE PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  47.  SERVICING, REPAIR OR CORRECTION.
  48.  
  49.  IN NO EVENT UNLESS WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  50.  REDISTRIBUTE THE PROGRAMS AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  51.  INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  52.  OUT OF THE USE OR INABILITY TO USE THE PROGRAMS (INCLUDING BUT NOT LIMITED
  53.  TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  54.  YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAMS TO OPERATE WITH ANY
  55.  OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
  56.  THE POSSIBILITY OF SUCH DAMAGES.
  57.  
  58.  Well, and have a nice day :-)
  59.  
  60.  AMIGA PORT
  61.  ----------
  62.  Well, at first I decided to port the two programs "yuvpak.c" and "yuvpak.c",
  63.  which I found in the path "UTIL/YUV20" on the Franzis Verlag's
  64.  "Grafik Tools" CD/ROM.
  65.  These two tools dealt with applying an YUV transformation to 24 Bit
  66.  data read from a 256x256 Targa file, did some fractal compression on
  67.  it and then wrote the proprietary IFS file format out of it.
  68.  
  69.  Unfortunately these tools were limited to a size of 256x256 and
  70.  due to some major "features" in the file header (using GCC bitfields
  71.  and possibly int*l byte order) I never got it working right on the Amiga
  72.  with SAS/C V6.56, while the DOS pendants worked quite nice.
  73.  Amiga compilates were extremely slow, used too much stack size and
  74.  produced bad output. That was mostly caused by the DOS-specific
  75.  and unoptimized C-Sourcecode used in yuvpack.c, yuvunpack.c and wdyusual.c
  76.  
  77.  I decided to follow the URL links given and looked for possible newer
  78.  version of these two tools - what  I found, were two other tools:
  79.  env.c and dec.c do not accept 24 Bit TGA files, but 8 Bit gray RAW
  80.  instead, but are actually much more better optimized and quite fast
  81.  on 256x256 pictures with default settings (some minutes for encoding,
  82.  a few seconds for decoding).
  83.  Also, all sizes (width/height must be divideable by 8) now are supported.
  84.   
  85.  To get a practical use out of these tools, perhaps much, much work
  86.  still has to be done.
  87.  
  88.  Since Y. Fisher's distribution restrictions do not allow any
  89.  "closed shop development" but require it to be freely distributable
  90.  and modifyable for all other people, I decided to release this
  91.  Amiga port as a package, which anyone may take a look at and make
  92.  suggestions to.
  93.  
  94.  I have a rough idea of making an IFF file format and datatype out of
  95.  it and need people making speed improvements on the algorithms and
  96.  suggestions for the file format (see SUGGESTIONS section).
  97.  
  98.  Of course, the result should be free again, respecting the license given
  99.  by Y. Fisher (see file COPYING).
  100.  
  101.  
  102.  USAGE
  103.  -----
  104.  Well, please read the file "USAGE" for any missing information
  105.  in here - it's the original one from Y. Fisher.
  106.  
  107.  
  108.  Set the stacksize for your CLI/Shell to a HIGH value !
  109.  
  110.  The Tools:      o    enc [options] infile.RAW outfile.FRC
  111.  
  112.                       You need 8 Bit gray RAW input, which most
  113.                       simply can be generated by cutting of the
  114.                       header from PGM (P5) file (can be created
  115.                       with tools from the PBM package and then
  116.                       edited with a hex or capable text editor).
  117.                       SuperView's PNM.svobject also allows
  118.                       to generate RAW files as with PNM V3.4.
  119.  
  120.                  o    dec [options] infile.FRC outfile.RAW
  121.  
  122.                       8 Bit gray RAW output, will be generated,
  123.                       which most simply again can be turned into
  124.                       a PGM (P5) file by adding the necessary
  125.                       information header with a hex or capable
  126.                       text editor - again ;-)
  127.  
  128.  As you can see, the creation of a fractal-compressed 24 Bit file
  129.  would require splitting it into three single files for each
  130.  of the red, green and blue components and then compressing these
  131.  as single files - just as if these were "gray".
  132.  
  133.  This is the point, were improvements have to take place
  134.  (see SUGGESTIONS section).
  135.  
  136.  
  137.  INCONVENIENCE ABOUT POSSIBLE INCOMPLETENESS
  138.  -------------------------------------------
  139.  Sorry for any possible missing parts of the distribution, but
  140.  my FTP access to Y. Fishers site was _very_ bad, so that I only
  141.  could download some of the single text files laying there and not the
  142.  full 73K tar.gz archive.
  143.  
  144.  For the complete sources by Y. Fisher please refer to
  145.  http://inls.ucsd.edu/y/home.html where you may branch to
  146.  http://inls.ucsd.edu/y/fractals/ and obtain the possible rest from.
  147.  
  148.  
  149.  CHANGES
  150.  -------
  151.  See file CHANGES.AMIGA (and the sources enc.c and dec.c) for which
  152.  changes had to be made to the original sources (included in the
  153.  directory "source_original").
  154.  
  155.  
  156.  SUGGESTIONS
  157.  -----------
  158.  Since the only popular fractal image file format FIF is
  159.  - different from e.g. JFIF's JPEG file format - protected
  160.  by patent claims and large license fees, the work of
  161.  Y. Fisher could be seen as an alternative way to make
  162.  a free fractal image file format possible.
  163.  
  164.  If some improvements on compression speed (by keeping compatibility)
  165.  could be made, this file format may have a decent chance (remember,
  166.  how slow JPEG was in the beginning).
  167.  Decoding already is quite fast, compared with enconding.
  168.  
  169.  To not complicate things, the resulting file format should be
  170.  of type IFF and not change anything of the original, basic design.
  171.  It should just store the resulting three .FRC files, which
  172.  were created after splitting a 24 Bit source into their components,
  173.  and some additional information from the common file header
  174.  (image size and compression ratio).
  175.  8 Bit Gray type files also should be supported.
  176.  
  177.  
  178.  IFF specification
  179.  -----------------
  180.  The file format should be called IFF-FRIC
  181.  (Fractal Image Container File Format)
  182.   ^^      ^     ^
  183.  
  184.  
  185.  Consider the following IFF specification:
  186.  
  187.  /* ------------------------------------------------------ */
  188.  
  189. #include <exec/types.h>
  190. #include <libraries/iffparse.h>
  191.  
  192. #define ID_FRIC  MAKE_ID('F','R','I','C') /* the FORM type */
  193.  
  194. #define ID_F_RD  MAKE_ID('F','_','R','D')
  195. #define ID_F_GR  MAKE_ID('F','_','G','R')
  196. #define ID_F_BL  MAKE_ID('F','_','B','L')
  197. #define ID_F_EY  MAKE_ID('F','_','E','Y')
  198.  
  199.  struct FRHD_Chunk /* FRIC Header */
  200.   {
  201.    ULONG width;  /* must be divideable by 8 */
  202.    ULONG height; /* must be divideable by 8 */
  203.    ULONG depth;  /* either 8 or 24          */
  204.  
  205.    ULONG m_flag; /* compression, see enc.c  */
  206.    ULONG t_flag; /* compression, see enc.c  */
  207.   };
  208.  
  209.  /* ------------------------------------------------------ */
  210.  
  211.  A typical FRIC file should be structured as follows, where
  212.  all typical IFF graphics chunks, like CAMG, AUTH, ANNO, etc.
  213.  as well can and should be present:
  214.  
  215.      1.  Grayscaled graphics)
  216.  
  217.      FORM-FRIC
  218.           FRHD
  219.             -----------------------
  220.              the FRHD header data
  221.             -----------------------
  222.           CAMG
  223.             -----------------------
  224.             Amiga 32 Bit CAMG chunk
  225.             -----------------------
  226.           F_EY
  227.             -----------------------
  228.             8 Bit gray image data
  229.             (complete FRC file content)
  230.             -----------------------
  231.  
  232.  
  233.      2.  24 Bit graphics
  234.  
  235.      FORM-FRIC
  236.           FRHD
  237.             -----------------------
  238.              the FRHD header data
  239.             -----------------------
  240.           CAMG
  241.             -----------------------
  242.             Amiga 32 Bit CAMG chunk
  243.             -----------------------
  244.           F_RD
  245.             -----------------------
  246.             8 Bit RED component
  247.             (complete FRC file content)
  248.             -----------------------
  249.           F_GR
  250.             -----------------------
  251.             8 Bit GREEN component
  252.             (complete FRC file content)
  253.             -----------------------
  254.           F_BL
  255.             -----------------------
  256.             8 Bit BLUE component
  257.             (complete FRC file content)
  258.             -----------------------
  259.  
  260.